package com.feelingj.spring.boot.blog.service;

import java.util.Optional;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.feelingj.spring.boot.blog.domain.Vote;
import com.feelingj.spring.boot.blog.repository.VoteRepository;

/**
 * 
 * @ClassName:VoteServiceImpl
 * @Description:TODO
 * @author feelj
 * @date 2018年4月5日上午15:18:30
 */
@Service
public class VoteServiceImpl implements VoteService {

	@Autowired
	private VoteRepository voteRepository;
	
	@Override
	public Optional<Vote> getVoteById(Long id) {
		return voteRepository.findById(id);
	}
	
	@Override
	public void removeVote(Long id) {
		voteRepository.deleteById(id);
	}

}
